package cn.bigfire.wedesk.util;

import cn.bigfire.wedesk.bean.Wedesk;
import lombok.Data;

public class ScreenData {


    private long captureTime;
    private Wedesk.ScreensHot screensHot;

    public static ScreenData of(long captureTime, Wedesk.ScreensHot screensHot){
        ScreenData screenData = new ScreenData();
        screenData.captureTime = captureTime;
        screenData.screensHot = screensHot;
        return screenData;
    }

    public boolean isExpired() {
        if (screensHot.getData().length > 50000) {
            return false;//数据变动的大,必须发送
        } else {
            return System.currentTimeMillis() - this.captureTime > 1000;
        }
    }


    public long getCaptureTime() {
        return captureTime;
    }

    public void setCaptureTime(long captureTime) {
        this.captureTime = captureTime;
    }

    public Wedesk.ScreensHot getScreensHot() {
        return screensHot;
    }

    public void setScreensHot(Wedesk.ScreensHot screensHot) {
        this.screensHot = screensHot;
    }
}
